﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls; 
using System.IO;
using Adex;
using MediaMonitor.Common;

namespace MediaMonitor.SiteFiles
{
    public partial class downloadPlanning : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
               

                    String filename = Utility.GetRequestedVal("odid", "");

                    if (File.Exists(HttpContext.Current.Server.MapPath("../outdoor-street/" + filename + ".JPG")))
                    {
                    Utility.DownloadFile("../outdoor-street/" + filename + ".JPG", true);
                    }
                    else
                    {
                       string script = "alert(\"No Image Exists!\");";
                       ScriptManager.RegisterStartupScript(this, this.GetType(), "ServerControlScript", script, true);
                    }
                }

              
           
        }
    }
}